package com.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dao.UserDao;
import com.model.User;
import com.service.UserService;
import com.util.Pagination;

@Service("UserService")
public class UserServiceImpl implements UserService {

    private UserDao userDao;

    public UserDao getUserDao() {
        return userDao;
    }

    @Resource(name = "UserDao")
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public boolean save(User transientInstance) {
        return userDao.save(transientInstance);

    }

    @Override
    public void deleteById(int uid) {
        userDao.deleteById(uid);

    }

    @Override
    public User merge(User detachedInstance) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public User findById(Integer id) {
        // TODO Auto-generated method stub
        return userDao.findById(id);
    }

    @Override
    public List<User> findByExample(User instance) {
        return userDao.findByExample(instance);
    }

    @Override
    public List findAll() {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public List<User> getUserList(User user, Pagination page) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public User editUser(User user) {

        return userDao.editUser(user);
        // TODO Auto-generated method stub

    }

}
